home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
EDITOR
/
AMAC44.ARJ
/
MIS007.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
16KB
|
387 lines
* mis007.qm
* Macros To Set/Delete Custom Tab Stops
* Written By Tom Hogshead
* Modifications to Macros Originally Written By John Goodman
* [ See MISCxx.QM For Use ]
* 6/2/92
* Key Description
* ===== =================================================================
* Set/Delete Tab Stops...
* @0 - Set Standard Custom Tab Stops at Columns 5, 10, ... 75 ( )
* @1 - Set/Delete Custom Tab Stops by Column Number
* Like w/Ins
* Move Cursor... ----- -----
* @2 - to Previous Custom Tab Stop TabLt Off
* @3 - to Next Custom Tab Stop TabRt Off
* Tab...
* @4 - to Previous Custom Tab Stop, Shift Text Left TabLt On
* @5 - to Next Custom Tab Stop, Shift Text Right TabRt On
*
* @6 - Delete All Custom Tab Stops
*
* {e:\up\MISC*} Return To MISCxx.QM
*
*-- eoi
* DESCRIPTION
* ------------
* These macros enable the user to set and/or delete custom tab
* stops. I have modified the macros, originally written by John
* Goodman in SemWare Macros Conference 3, Message #431, 6-25-91, to
* take advantage of QEdit v2.15 SetScreenOFF|ON commands and to
* work irrespective of all qconfig settings. These modified macros
* are also in AMAC43.ZIP, mis007.qm with different key assignments.
* NOTE: If this macro is invoked on line 1 and qconfig is set to
* insert lines *below* current line, macros @0 and @2-5
* will add one extra line on top of file. All macros,
* except @0 and @1, will fit on one line of qconfig.dat by
* removing "Label" from Qmac compiled macro and formatting
* to a right margin of 500. All macros require QEdit v2.15.
* M A C R O S
* ----------------------------------------------------------------------
* @(0) Set Standard Custom Tab Stops At Columns 5, 10, 15, ... 75
* ----------------------------------------------------------------------
* This macro sets custom tab stops at columns 5, 10, 15, ... 75 either
* by invoking this macro while editing or at the command line to edit
* [file]:
* q. [file] /Emis007.mac /Lmis007.mac
* For example, to load this file from the command line with a standard
* set of custom tab stops at columns 5,10...75, use the command:
* q. mis007.qm /Emis007.mac /Lmis007.mac
* Change Gotocolumn lines for different custom tab stops.
@0 MacroBegin
SetScreenOff SaveSettings SetWordWrapMode ToggleWordWrap
GetScrBuff * Try retrieving existing tab ruler
"TAB" Return * buffer
JTrue LOOP * If found, set standard tab stops
*--Create Tab Ruler if it doesn't exist
InsertLine * Insert line above
AddLine * Add line below
BegLine
MarkCharacter * Start block
"vvvv5vvvv0" * Type ruler chars
Copy * Copy the block
BegLine * Return to line begin
Paste * Paste copy of ruler chars
RepeatCmd * Paste 6 more copies for 80 char ruler
"6" Return
MarkLine * Mark both created lines
CursorUp
LOOP:
iscursorinblock * Test if cursor is in block
JTrue IN_BLOCK * If true, we're set to insert above line or
* tab ruler did not exist
cursorup *ELSE qconfig set to insert *below* line
JTrue NOT_LINE#1 * If we can cursor up, we're not on line 1
insertline *ELSE, we're on line 1, make room to move block
NOT_LINE#1:
moveblock * Move block above current line
IN_BLOCK:
gotoblockbeg * Move cursor to block begin
begline deltoeol * Delete tab ruler buffer
gotocolumn "5" return "T" gotocolumn "10" return "T"
gotocolumn "15" return "T" gotocolumn "20" return "T"
gotocolumn "25" return "T" gotocolumn "30" return "T"
gotocolumn "35" return "T" gotocolumn "40" return "T"
gotocolumn "45" return "T" gotocolumn "50" return "T"
gotocolumn "55" return "T" gotocolumn "60" return "T"
gotocolumn "65" return "T" gotocolumn "70" return "T"
gotocolumn "75" return "T"
END:
StoreScrBuff * Store the TAB ruler
"TAB" Return
SetScreenOn
DeleteBlock * Get rid of the ruler lines
RestoreSettings
*
* 194 bytes Wed 02-12-1992 14:52:25 (TH @0)
* 199 bytes Thu 02-13-1992 11:04:42 (TH @0, OK if on line 1)
*
* ----------------------------------------------------------------------
* @(1) Set/Delete Custom Tab Stops by Column Number
* ----------------------------------------------------------------------
* Invoke this macro to set or delete a custom tab stop. Insert desired
* tab stop column number at the pause, or "0" or "1" to end macro.
* EXAMPLES
* ---------
* a) To set custom tab stops at columns 5, 10 and 15 with @1:
* 5 <enter>
* 10 <enter>
* 15 <enter>
* 0 <enter> (Stops macro)
* b) To remove custom tab stop at column 10 with @1:
* 10 <enter>
* 0 <enter> (Stops macro)
@1 MacroBegin
SetScreenOff SaveSettings SetWordWrapMode ToggleWordWrap
GetScrBuff * Try retrieving existing tab ruler
"TAB" Return * buffer
JTrue LOOP * If found, allow user to change it
*--Create Tab Ruler if it doesn't exist
InsertLine * Insert line above
AddLine * Add line below
BegLine
MarkCharacter * Start block
"vvvv5vvvv0" * Type ruler chars
Copy * Copy the block
BegLine * Return to line begin
Paste * Paste copy of ruler chars
RepeatCmd * Paste 6 more copies for 80 char ruler
"6" Return
MarkLine * Mark both created lines
CursorUp
LOOP: * Loop until user stops
SetScreenOn
GotoColumn * Prompt user for tab column number
Pause Return * If user enters Return,0,or 1,
SetScreenOff
BegLine * Begline will not move (user done)
JFalse END
PrevPosition * Go back to user's column
GotoBlockBeg * Reqd if Qconfig set to insert blocks *below* line
MarkColumn * Mark current & previous char
CursorLeft
Find "T" Return * Test if 'T' already in column
"L" Return
JTrue DELTAB * If 'T' there, go delete it
CursorRight * 'T' not there, add one & make sure
CursorRight * any following it are not shifted
BackSpace "T" * regardless of Ins mode
Jump OKAY
DELTAB:
CursorRight * Delete 'T' regardless of Ins mode
BackSpace " "
OKAY: * 'T' added or deleted, re-mark
CursorDown * both lines of tab ruler
MarkLine
CursorUp
Jump LOOP * Prompt user for another column #
END:
StoreScrBuff * Store the TAB ruler
"TAB" Return
DeleteBlock * Get rid of the ruler lines
RestoreSettings
*
* 98 bytes Fri 05-31-1991 00:09:37 (JG @1)
* 102 bytes Thu 02-06-1992 12:31:47 (TH @1, mod to JG @1)
* 103 bytes Wed 02-12-1992 12:19:02 (TH @1, for all qconfig's)
*
* ----------------------------------------------------------------------
* @(2) Move Cursor to Previous Custom Tab Stop
* ----------------------------------------------------------------------
@2 MacroBegin
SetScreenOff
GetScrBuff * Retrieve Tabs Ruler Buffer
"TAB" Return
JFalse END * End macro if buffer not defined
iscursorinblock
JTrue ABOVE * Test if Qconfig set to insert blocks *below* line
cursorup * If false, Qconfig set to insert blocks *below*
* line, position to move block above line
JTrue MOVE * Test if we're on line 1
insertline *ELSE we must be on line 1, make room to moveblock
MOVE:
moveblock * Move block above line
ABOVE:
GotoBlockBeg * Reqd if Qconfig set to insert blocks *below* line
WordLeft * Move to previous 'T'; if before 1st 'T'
* will move to end of previous line
EndLine * Endline will not move if on prev line
iscursorinblock
JTrue 1 * Test if cursor on line above Tabs Ruler Buffer
cursordown * If false, move down to begin of Tabs Ruler Buffer
begline * Move to col 1
Jump 2
1:
PrevPosition * If true, return to previous position
2:
DelLine DelLine * Delete tabs ruler lines and retain cursor column
END:
*
* 20 bytes Thu 05-30-1991 23:18:53 (JG @2)
* 22 bytes Thu 02-06-1992 11:35:36 (TH @2, mod to JG @2)
* 37 bytes Mon 02-10-1992 17:47:10 (TH @2, for all Qconfig settings)
* 41 bytes Tue 02-11-1992 14:12:14 (TH @2, OK if on line 1)
*
* ----------------------------------------------------------------------
* @(3) Move Cursor to Next Custom Tab Stop, Beeps If Beyond Last Tab
* ----------------------------------------------------------------------
@3 MacroBegin
SetScreenOff SaveSettings SetSoundOn
GetScrBuff * Retrieve Tabs Ruler Buffer
"TAB" Return
JFalse END * End macro if buffer not defined
iscursorinblock
JTrue ABOVE * Test if Qconfig set to insert blocks *below* line
cursorup * If false, Qconfig set to insert blocks *below*
* line, position to move block above line
JTrue MOVE * Test if we're on line 1
insertline *ELSE we must be on line 1, make room to moveblock
MOVE:
moveblock * Move block above line
ABOVE:
GotoBlockBeg * Reqd if Qconfig set to insert blocks *below* line
Find "T" Return
"L" Return
DelLine DelLine * Delete tabs ruler lines and retain cursor column
END:
RestoreSettings
*
* 24 bytes Mon 06-24-1991 19:00:18 (JG @3)
* 29 bytes Thu 02-06-1992 11:35:32 (TH @3, mod to JG @3)
* 35 bytes Mon 02-10-1992 17:40:34 (TH @3, for all Qconfig settings)
* 39 bytes Tue 02-11-1992 14:05:50 (TH @3, OK if on line 1)
*
* ----------------------------------------------------------------------
* @(4) Tab Left to Previous Custom Tab Stop, Shift Text Left
* ----------------------------------------------------------------------
* This macro shifts all text right of cursor LEFT to first previous
* custom tab stop, like tablt with Insert On except if a single char is
* in col 1, the cursor is positioned in col 2.
@4 MacroBegin
SetScreenOff
isbegline
JTrue END * End macro if at line begin
splitline *ELSE split line at current position
GetScrBuff * Retrieve Tabs Ruler Buffer
"TAB" Return
JFalse END * End macro if buffer not defined
iscursorinblock
JTrue ABOVE * Test if Qconfig set to insert blocks *below* line
cursorup * If false, Qconfig set to insert blocks *below*
* line, position to move block above line
JTrue MOVE * Test if we're on line 1
insertline *ELSE we must be on line 1, make room to moveblock
MOVE:
moveblock * Move block above line
ABOVE:
GotoBlockBeg * Reqd if Qconfig set to insert blocks *below* line
MarkColumn
CursorRight * Move right
EndLine * Test if at end of ruler
JTrue NEXTSTOP
CursorLeft * If at end, move back 2 spaces
CursorLeft
NEXTSTOP:
PrevPosition * Return to original position (unless
CursorLeft * at exact end of ruler tested above)
wordleft * Move to previous 'T'
isendline
JFalse NO_EOL * Test if at end of line
cursordown * If at end of line move down to
begline * begin of line
NO_EOL:
cursordown * Move down to ruler key line
delline * Delete it
markcolumn * Extend block to current line
gotoblockend
cursorleft * Move to end of block 1 char left
endline * Move to end of line
JTrue EOL * Test if we were already at eol
cursorleft * If already at end of line, move one char left
EOL:
iscursorinblock
JTrue INBLOCK * Test if cursor in block
gotoblockbeg * If not, move to tab stop
cursordown * Position to rejoin
INBLOCK:
joinline * Joinline
cursorup delline * Delete tab stop line
unmarkblock * Unmark current line
END:
*
* 65 bytes Mon 02-10-1992 17:49:32 (TH @4)
* 69 bytes Tue 02-11-1992 14:12:44 (TH @4, OK if on line 1)
*
* ----------------------------------------------------------------------
* @(5) Tab Right to Next Custom Tab Stop, Shift Text Right
* ----------------------------------------------------------------------
* This macro shifts all text right of cursor RIGHT to next custom tab
* stop, like tabrt with Insert On.
@5 MacroBegin
SetScreenOff
GetScrBuff * Retrieve Tabs Ruler Buffer
"TAB" Return
JFalse END * End macro if buffer not defined
iscursorinblock
JTrue ABOVE * Test if Qconfig set to insert blocks *below* line
cursorup * If false, Qconfig set to insert blocks *below*
* line, position to move block above line
JTrue MOVE * Test if we're on line 1
insertline *ELSE we must be on line 1, make room to moveblock
MOVE:
moveblock * Move block above line
ABOVE:
GotoBlockBeg * Reqd if Qconfig set to insert blocks *below* line
MarkColumn
CursorRight * Move right
EndLine * Test if at end of ruler
JTrue NEXTSTOP
CursorLeft * If at end, move back 2 spaces
CursorLeft
NEXTSTOP:
PrevPosition * Return to original position (unless
CursorLeft * at exact end of ruler tested above)
WordRight * Move to next 'T'; if beyond end of ruler
* will move to 1st char of next line
BegLine * Begline will not move if on 2nd line
PrevPosition * Return to last position
MarkColumn
GotoBlockBeg
Copy
DelLine DelLine * Delete tabs ruler lines and retain cursor column
Paste
FillBlock
" " Return
DelCh
GotoBlockEnd
CursorLeft
UnmarkBlock
END:
*
* 42 bytes Fri 05-31-1991 00:39:58 (JG @6)
* 44 bytes Thu 02-06-1992 11:35:40 (TH @5, mod to JG @6)
* 50 bytes Mon 02-10-1992 17:46:51 (TH @5, for all Qconfig settings)
* 54 bytes Tue 02-11-1992 14:12:29 (TH @5, OK if on line 1)
*
* ----------------------------------------------------------------------
* @(6) Delete All Custom Tab Stops
* ----------------------------------------------------------------------
@6 macrobegin
getscrbuff "TAB" return * Retrieve Tabs Ruler Buffer
JFalse END
begline
gotoblockbeg * Need if qconfig set to insert *below* line
deltoeol * Delete all tab stops
storescrbuff "TAB" return * Store Ruler Buffer - no tab stops
deleteblock * Delete Ruler Buffer - no tab stops
prevposition begline * Need if qconfig set to insert *below* line
END:
*
* 29 bytes Wed 02-12-1992 14:59:47 (TH @6)